import cv2
import numpy as np
import pyautogui
import time
from SendInput import Keyboard, Mouse
from win32com.client import Dispatch
import os
op=Dispatch("op.opsoft")

def colsetan () : 
    time.sleep( 0.1 )
    Mouse.move(459, 9, True)
    time.sleep( 0.1 )
    Mouse.leftClick()
    time.sleep( 0.1 )
    return

def move_towards_target(target_position):
    text = op.Ocr(2473,36,2509,50,"",1)
    text2 = op.Ocr(2513,36,2552,50,"",1)
    print(text)
    print(text2)

colsetan()
time.sleep( 0.5 )
# for i in range(10):
#     move_towards_target([323, 577])
# # while True:
        # pos = find_target_position()
        # if pos:
        # move_towards_target([323, 577])
        # if cv2.waitKey(1) & 0xFF == ord('q'):
        #     break